var
  i, j, n, q: longint;

begin
  readln(n);
  for i := 1 to n do 
  begin
    q := ((2 * n + i - 2) mod (2 * n)) + 1;
    for j := 0 to n - 1 do 
      
      write(i + j, ' ', (q - j - 1 + 2 * n) mod (2 * n) + 1, ' ');
    writeln(2 * n + 1);
  end;
end.